﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Classes="clr-namespace:SqliteHelper.Classes">

   <ResourceDictionary.MergedDictionaries>
      <ResourceDictionary Source="/SqliteHelper;component/Resources/Common.xaml" />
   </ResourceDictionary.MergedDictionaries>
   
   <DataTemplate DataType="{x:Type Classes:NewDatabaseViewModel}">
      <Grid>
         <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
         </Grid.RowDefinitions>

         <StackPanel Orientation="Horizontal"
                     Grid.Row="0">               
            <Image Source="/SqliteHelper;component/Images/database_add.png"
                     Margin="0,0,5,0"/>
            <TextBlock Text="New Database"
                        FontSize="16"
                        FontWeight="Bold" />
         </StackPanel>

         <Grid Grid.Row="1"
               Margin="0,10,0,0">
            <Grid.ColumnDefinitions>
               <ColumnDefinition Width="Auto" />
               <ColumnDefinition Width="*" />
               <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock Text="Path:"
                        Margin="0,0,5,0"
                        Grid.Column="0"
                        VerticalAlignment="Center" />
            <TextBox Grid.Column="1"
                     Text="{Binding Path=DatabasePath, UpdateSourceTrigger=PropertyChanged}"/>
            <Button Content="Browse..."
                    Margin="5,0,0,0"
                    Grid.Column="2"
                    Command="{Binding Path=BrowseCommand}"/>
         </Grid>

         <GroupBox Header="Encoding"
                     Margin="0,10,0,0"
                     Grid.Row="2">
            <Grid Margin="5">
               <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="*" />
                  <ColumnDefinition Width="*" />
               </Grid.ColumnDefinitions>
               <RadioButton Content="UTF-8"
                              IsChecked="{Binding Path=IsUtf8}"
                              HorizontalAlignment="Center"
                              Grid.Column="0" />
               <RadioButton Content="UTF-16"
                              HorizontalAlignment="Center"
                              Grid.Column="1" />
            </Grid>
         </GroupBox>
            
         <TextBlock Text="{Binding Path=ErrorText}"
                    Foreground="DarkRed"
                    Grid.Row="3"/>
      </Grid>
   </DataTemplate>

</ResourceDictionary>